package gouhuo.allbugs.top.utils;

import gouhuo.allbugs.top.common.BaseResponse;

/**
 * 返回工具类
 *
 * @author 15294780204
 */
public class ResultUtil {

    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(0, data, "ok");
    }

    public static BaseResponse success() {
        return new BaseResponse(0, "ok");
    }

    public static BaseResponse<String> success(String message) {
        return new BaseResponse(0, message);
    }

    public static BaseResponse error(int code, String message) {
        return new BaseResponse(code, message);
    }

    public static BaseResponse error(String message) {
        return new BaseResponse(message);
    }

}